<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>修改个人密码</title>
<link rel="stylesheet" href="${path}/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${path}/css/system.css">
<script src="${path}/bootstrap/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="${path}/bootstrap/js/bootstrap.min.js"></script>
<script src="${path}/js/jquery.validate.min.js"></script>
<script>
	//加载事件
	$(function(){
		//让当前表单调用validate方法，实现表单验证功能
		$("#form").validate({
			rules:{     //配置验证规则，key就是被验证的dom对象，value就是调用验证的方法(也是json格式)
				oldPwd:{
					required:true,
					rangelength:[4,6]
				},
				newPwd:{
					required:true,
					rangelength:[4,6]
				},
				submitpwd:{
					required:true,
					rangelength:[4,6],
					equalTo:'#newPwd'
				}
			},
			messages:{
				oldPwd:{
					required:"请输入旧密码",
					rangelength:"长度必须在4-6之间"
				},
				newPwd:{
					required:"请输入新密码",
					rangelength:"长度必须在4-6之间"
				},
				submitpwd:{
					required:"请输入确认密码",
					equalTo:"两次输入不一致",
					rangelength:"长度必须在4-6之间"
				}
			}
		});
	});
</script>
<style>
	.error{color:red !important;}
</style>
</head>
<body>
	<div class="container-fluid" >
		<div>
			<ol class="breadcrumb">
			  <li><a href="#">当前位置:主页</a></li>
			  <li><a href="#">个人信息</a></li>
			  <li class="active">修改个人密码</li>
			</ol>
			<div class="data_form">
				<form id="form" action="${path}/personal.do" method="post" >
					<input type="hidden" name="method" value="updatePassword">
					<table >
						<tr>
							<td>
								<label for="oldPwd">请输入原密码：</label>
							</td>
							<td>
								<input type="password" id="oldPwd" name="oldPwd" value=""/>
								${error}
							</td>
						</tr>
						<tr>
							<td>
								<label for="newPwd">请输入新密码：</label>
							</td>
							<td>
								<input type="password" id="newPwd" name="newPwd" value=""/>
							</td>
						</tr>
						<tr>
							<td>
								<label for="submitpwd">再次确认新密码：</label>
							</td>
							<td>
								<input type="password" id="submitpwd" name="submitpwd" value=""/>
							</td>
						</tr>
						<tr>
							<td>
								
							</td>
							<td>
								<input type="submit" class="btn btn-primary btn-xs" value="保存"/>&nbsp;&nbsp;
								<input type="button" onclick="history.back()" class="btn btn-primary btn-xs" value="返回" />
							</td>
						</tr>
						
					</table>
				</form>
			</div>
		</div>
	</div>
</body>
</html>